﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="score_search_update_delete.aspx.cs" Inherits="update_score" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>查看、更新、删除学生成绩</title>
    <style type="text/css">

        .auto-style2 {
            text-align: center;
        }
        .auto-style3 {
            font-size: x-large;
        }
        .auto-style1 {
            font-size: large;
        }
        </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <div class="auto-style2">
            <strong><span class="auto-style3">查看、更新、删除</span></strong><span class="auto-style3"><strong>学生成绩：</strong></span><br class="auto-style3" />
        <br />
            <span class="auto-style1">请选择班级：</span><asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="Sclass" DataValueField="Sclass" CssClass="auto-style1">
        </asp:DropDownList>
        </div>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT [Sclass] FROM [Student]"></asp:SqlDataSource>
        <div class="auto-style2">
        <br />
            <span class="auto-style1">请选择学期：</span><asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="term" DataValueField="term" CssClass="auto-style1">
        </asp:DropDownList>
        </div>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT distinct [term] FROM [Course]"></asp:SqlDataSource>
        <br />
        <br />
    
    </div>
        <center>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Sno,Cno" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" AllowPaging="True" AllowSorting="True">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Sno" HeaderText="Sno" ReadOnly="True" SortExpression="Sno" />
                <asp:BoundField DataField="Sname" HeaderText="Sname" SortExpression="Sname" />
                <asp:BoundField DataField="Cno" HeaderText="Cno" ReadOnly="True" SortExpression="Cno" />
                <asp:BoundField DataField="Cname" HeaderText="Cname" SortExpression="Cname" />
                <asp:BoundField DataField="score" HeaderText="score" SortExpression="score" />
                <asp:HyperLinkField DataNavigateUrlFields="Sno,Cno,Sname,Cname" DataNavigateUrlFormatString="update_score_detail.aspx?Sno={0}&amp;Cno={1}&amp;Sname={2}&amp;Cname={3}" HeaderText="更新" Text="更新" />
                <asp:HyperLinkField HeaderText="删除" Text="删除" DataNavigateUrlFields="Sno,Sname,Cno,Cname" DataNavigateUrlFormatString="delete_score.aspx?Sno={0}&amp;Sname={1}&amp;Cno={2}&amp;Cname={3}" />
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
            </center>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT result.Sno,Student.Sname,result.Cno,Course.Cname,result.score
FROM result,Student,Course
where result.Sno=Student.Sno and result.Cno=Course.Cno and Course.term=@term and Student.Sclass=@class">
            <SelectParameters>
                <asp:ControlParameter ControlID="DropDownList2" Name="term" PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="DropDownList1" Name="class" PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
